In recent years, it has become easier to acquire a large amount of image data such as photographs because of the widespread use of a digital camera. Meanwhile, it is cumbersome to manually classify those pieces of image data into groups for viewing, for example. Therefore, there has been developed a technology for classifying pieces of image data into a plurality of groups by using a computer as in a technology for classifying a plurality of images into groups based on whether or not an interval between photographed times of the images is a threshold value or larger, which is disclosed in Patent Literature 1.